<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="container" /></title>
</head>
<body>
    <h1><fmt:message key="container" /></h1>
    <c:url var="updateUrl" value="/domain/container/update.action"/>
    <form:form action="${updateUrl}" id="containerForm" modelAttribute="containerForm" >
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="container.inode"/>
            <tbody>
                <tr>
                    <th><fmt:message key="container_title" />*</th>
                    <td>
                        <form:input path="container.title"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "container.title",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : true
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="container.title"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="container_friendlyName" /></th>
                    <td>
                        <form:input path="container.friendlyName"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "container.friendlyName",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="container.friendlyName"/>
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="container_maxContentlets" /></th>
                    <td>
                        <form:input path="container.maxContentlets"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "container.maxContentlets",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="container.maxContentlets"/>
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="container_code" /></th>
                    <td>
                        <form:textarea path="container.code"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "container.code",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="container.code"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="container_notes" /></th>
                    <td>
                        <form:input path="container.notes"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "container.notes",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="container.notes"/>
                    </td>
                </tr>

            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/container/show.action">
                                <c:param name="container.inode" value="${containerForm.container.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
